import Vue from 'vue'
import store from '../store/index'
import VueI18n from 'vue-i18n'

import zh from './zh'
import en from './en'
import ja from './ja'

Vue.use(VueI18n)

const messages = {
  en,
  zh,
  ja
}

const i18n = new VueI18n({
  locale: store.state.language,
  // locale: 'zh',
  silentTranslationWarn: process.env.NODE_ENV === 'development',
  messages: messages
})
// eslint-disable-next-line no-undef
uw.Locale.use({
  lang: store.state.language
})
export default i18n
